/**
 *
 *	You need to complete the constructors, setHourlyPay, 
 *     computeBiweeklyPaycheck, and print methods.
 *
 * A simple class to represent and Employee who gets paid by the hour.
 */

/**
 * @author Andrew Shore
 * @author clint
 * 
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class HourlyEmployee extends Employee {
	/**
	 * <i>MINIMUMWAGE</i> is the minimum amount that an HourlyEmployee can make
	 * an hour.
	 */
	public static final double MINIMUMWAGE = 4.50;

	/**
	 * <i>hourlyPay</i> is a decimal representation of the amount of money the
	 * Employee makes per hour.
	 */
	private double hourlyPay;

	/**
	 * default constructor
	 */
	public HourlyEmployee() {
		super();
		hourlyPay=0;
	}

	public HourlyEmployee(String name, int age, String jobTitle,
			double newHourlyPay) {
			super(name, age, jobTitle);
			hourlyPay=newHourlyPay;

	}

	/**
	 * postcondition: returned the <i>hourlyPay</i> of the HourlyEmployee.
	 */
	public double getHourlyPay() {
		return hourlyPay;
	}

	/**
	 * precondition: the parameter <i>hourlyPay</i> is >= than than the
	 * MINIMUMWAGE.
	 * 
	 * postcondition: the HourlyEmployee's <i>hourlyWage</i> has been set to
	 * the value of the parameter of the parameter <i> hourlyWage</i> if and
	 * only if the parameter is >= to the <i>MINIMUMWAGE</i>.
	 */
	public void setHourlyPay(double newHourlyPay) {
		if(newHourlyPay>=MINIMUMWAGE){
			hourlyPay=newHourlyPay;
		}
		
	}

	/**
	 * postcondition: the amount of money the Employee makes every two weeks is
	 * returned.
	 * 
	 */
	public double computeBiweeklyPaycheck() {
		double paycheck=hourlyPay*80;
		
		return paycheck;// to make compiler happy
	}

	/**
	 * postcondition: all of the information about this Hourly Employee will be
	 * printed to the console.
	 */
	public void print() {
		super.print();
		//hint: should you call the print method in
		//  the parent class
		System.out.println("Hourly wage is "+hourlyPay);
		System.out.println("Biweekly paycheck is "+computeBiweeklyPaycheck());
		
	}

}

